﻿using Common;
using DAC.HttpWeb;
using Microsoft.Win32;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace NaverAuthStmp
{
    public partial class FormMainNaverAuthSmtp : Form
    {
        public delegate void DlgInvokeCtrUpdate(Control ctr, string strText);

        public delegate void DlgInvokeSetStatus(string strText);

        public delegate void DlgInvokeTabContol(int tabIndex);

		private int m_accountCur = 0;

		private int m_accountTotal = 0;

		private int m_serverCur = 0;

		private int m_serverTotal = 0;

		private int m_maillistCur = 0;

		private int m_maillistTotal = 0;

		private string m_smtpID;

		private string m_smtpPW;

		private string m_serverOnlyone;

		private bool m_isFixedServer = false;

		private bool m_isFixedAccount = false;

		private int m_bccCur = 0;

		private int m_DongBong = 0;

		private int m_Bcc = 0;

		private int m_thread = 0;

		private int m_autoPause = 0;

		private int m_eachMailNum = 0;

		private int m_autoPauseCount = 0;

		private int m_checkDelay = 0;

		private string m_testAccount;

		private string m_checkAccount;

		private int m_attachSize = 0;

		private string m_smtpServer;

		private int m_smtpPort = 0;

		private string m_domain;

		private bool m_isUseAttach = false;

		private bool m_isUseAccount = false;

		private bool m_isSSL = false;

		private bool m_isCheckSocket = false;

		private bool m_isAccountSettingSmtp = false;

		private int m_sendDelay = 0;

		private int m_sendLimitAccount = 0;

		private int m_sendLimitAccountCount = 0;

		private int m_rndDongBongMin = 0;

		private int m_rndDongBongMax = 0;

		private string m_helo;

		private string m_mailFrom;

		private string m_mailTo;

		private string m_fromName;

		private string m_xmailer;

		private string m_subject;

		private string m_body;

		private string m_attachSubject;

		private string m_attachBody;

		private string m_directHeader;

		private string m_fixedHelo;

		private string m_oldID;

		private int m_countDelay = 0;

		private int m_suc = 0;

		private int m_fail = 0;

		private int m_err = 0;

		private bool m_pause = false;

		private bool m_oneShot = false;

		private int m_countTask = 1;

		private List<string> listAccount;

		private List<string> listServer;

		private List<string> listMaillist;

		public Task taskListener;

		public TcpListener serverSocket;

		private List<TcpClient> listSocketTcpClient;

		public int port = 9998;

		public int port2 = 9999;

		public int port3 = 9997;

		public int countConnectingClient = 0;

		public TcpClient clientSocket;

		public string clNo;

		public Hashtable clientsListForClient;

		public NetworkStream serverStream;

		public bool m_isDoingListener = false;

		public bool m_isDoingClientWithServer = false;

		public bool m_isDoingGetMessageWithClient = false;

		private StreamReader stream_read;

		private StreamWriter stream_write;

		private static readonly object QueueLock = new object();

		private static readonly object FileLock = new object();

		private Random _random = new Random(Environment.TickCount);

		public FormMainNaverAuthSmtp()
        {
            InitializeComponent();
			this.skinEngine1.SkinFile = "DiamondGreen.ssk";

			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			this.m_smtpID = Convert.ToString(registryKey.GetValue("smtpID"));
			this.textBox_smtpID.Text = this.m_smtpID;
			this.m_smtpPW = Convert.ToString(registryKey.GetValue("smtpPW"));
			this.textBox_smtpPW.Text = this.m_smtpPW;
			this.m_serverOnlyone = Convert.ToString(registryKey.GetValue("serverOnlyone"));
			this.textBox_serverOnlyone.Text = this.m_serverOnlyone;
			this.m_isFixedServer = Convert.ToBoolean(registryKey.GetValue("isFixedServer"));
			this.checkBox_fixedServer.Checked = this.m_isFixedServer;
			if (this.m_isFixedServer)
			{
				this.textBox_serverOnlyone.Text = "";
			}
			this.m_isFixedAccount = Convert.ToBoolean(registryKey.GetValue("isFixedAccount"));
			this.checkBox_fixedAccount.Checked = this.m_isFixedAccount;
			if (this.m_isFixedAccount)
			{
				this.textBox_smtpID.Text = "";
				this.textBox_smtpPW.Text = "";
			}
			this.m_DongBong = Convert.ToInt32(registryKey.GetValue("DongBong"));
			this.textBox_dongbong.Text = this.m_DongBong.ToString();
			this.m_thread = Convert.ToInt32(registryKey.GetValue("thread"));
			this.textBox_thread.Text = this.m_thread.ToString();
			this.m_autoPause = Convert.ToInt32(registryKey.GetValue("autoPause"));
			this.textBox_autoPause.Text = this.m_autoPause.ToString();
			this.m_eachMailNum = Convert.ToInt32(registryKey.GetValue("eachMailNum"));
			this.textBox_eachMailNum.Text = this.m_eachMailNum.ToString();
			this.m_checkDelay = Convert.ToInt32(registryKey.GetValue("checkDelay"));
			this.textBox_checkDelay.Text = this.m_checkDelay.ToString();
			this.m_testAccount = Convert.ToString(registryKey.GetValue("testAccount"));
			this.textBox_testAccount.Text = this.m_testAccount;
			this.m_checkAccount = Convert.ToString(registryKey.GetValue("checkAccount"));
			this.textBox_checkAccount.Text = this.m_checkAccount;
			this.m_attachSize = Convert.ToInt32(registryKey.GetValue("attachSize"));
			this.textBox_attachSize.Text = this.m_attachSize.ToString();
			this.m_smtpServer = Convert.ToString(registryKey.GetValue("smtpServer"));
			this.textBox_smtpServer.Text = this.m_smtpServer;
			this.m_smtpPort = Convert.ToInt32(registryKey.GetValue("smtpPort"));
			this.textBox_smtpPort.Text = this.m_smtpPort.ToString();
			this.m_domain = Convert.ToString(registryKey.GetValue("domain"));
			this.textBox_domain.Text = this.m_domain;
			this.m_sendDelay = Convert.ToInt32(registryKey.GetValue("sendDelay"));
			this.textBox_sendDelay.Text = this.m_sendDelay.ToString();
			this.m_isUseAttach = Convert.ToBoolean(registryKey.GetValue("isUseAttach"));
			this.checkBox_isUseAttach.Checked = this.m_isUseAttach;
			this.m_isUseAccount = Convert.ToBoolean(registryKey.GetValue("isUseAccount"));
			this.checkBox_isUseAccount.Checked = this.m_isUseAccount;
			this.m_isSSL = Convert.ToBoolean(registryKey.GetValue("isSSL"));
			this.checkBox_isSSL.Checked = this.m_isSSL;
			this.m_sendLimitAccount = Convert.ToInt32(registryKey.GetValue("sendLimitAccount"));
			this.textBox_sendLimitAccount.Text = this.m_sendLimitAccount.ToString();
			this.m_helo = Convert.ToString(registryKey.GetValue("helo"));
			this.textBox_helo.Text = this.m_helo;
			this.m_mailFrom = Convert.ToString(registryKey.GetValue("mailFrom"));
			this.textBox_mailFrom.Text = this.m_mailFrom;
			this.m_mailTo = Convert.ToString(registryKey.GetValue("mailTo"));
			this.textBox_mailTo.Text = this.m_mailTo;
			this.m_fromName = Convert.ToString(registryKey.GetValue("fromName"));
			this.textBox_fromName.Text = this.m_fromName;
			this.m_xmailer = Convert.ToString(registryKey.GetValue("xmailer"));
			this.textBox_xmailer.Text = this.m_xmailer;
			this.m_subject = Convert.ToString(registryKey.GetValue("subject"));
			this.richTextBox_subject.Text = this.m_subject;
			this.m_body = Convert.ToString(registryKey.GetValue("body"));
			this.richTextBox_body.Text = this.m_body;
			this.m_attachSubject = Convert.ToString(registryKey.GetValue("attachSubject"));
			this.textBox_attachSubject.Text = this.m_attachSubject;
			this.m_attachBody = Convert.ToString(registryKey.GetValue("attachBody"));
			this.textBox_attachBody.Text = this.m_attachBody;
			this.m_Bcc = Convert.ToInt32(registryKey.GetValue("Bcc"));
			this.textBox_bcc.Text = this.m_Bcc.ToString();
			this.m_rndDongBongMin = Convert.ToInt32(registryKey.GetValue("rndDongBongMin"));
			this.textBox_rndDongbong_min.Text = this.m_rndDongBongMin.ToString();
			this.m_rndDongBongMax = Convert.ToInt32(registryKey.GetValue("rndDongBongMax"));
			this.textBox_rndDongbong_max.Text = this.m_rndDongBongMax.ToString();
			this.m_directHeader = Convert.ToString(registryKey.GetValue("directHeader"));
			this.richTextBox_directHeader.Text = this.m_directHeader;
			this.radioButton_alone.Checked = true;
			this.InItOpen();
			string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
			DirectoryInfo directoryInfo = new DirectoryInfo(folderPath + "\\슈퍼맨\\우표발송기");
			directoryInfo.Create();
			DirectoryInfo directoryInfo2 = new DirectoryInfo(folderPath + "\\슈퍼맨\\우표발송기\\로그");
			directoryInfo2.Create();
		}


		private void StartSocketSmtp(object threadNum)
		{
			try
			{
				string str = "";
				using (TcpClient tcpClient = new TcpClient())
				{
					int smtpPort = this.m_smtpPort;
					tcpClient.Connect(this.m_smtpServer, smtpPort);
					using (NetworkStream networkStream = tcpClient.GetStream())
					{
						using (SslStream sslStream = new SslStream(networkStream))
						{
							sslStream.AuthenticateAsClient(this.m_smtpServer);
							using (StreamWriter streamWriter = new StreamWriter(sslStream))
							{
								using (StreamReader streamReader = new StreamReader(sslStream))
								{
									string text = streamReader.ReadLine();
									this.SetStatus("CON" + text);
									if (!text.StartsWith("220"))
									{
										this.SetStatus("smtp접속실패");
										goto IL_054d;
									}
									streamWriter.WriteLine("HELO " + this.m_helo);
									streamWriter.Flush();
									string text2 = "";
									do
									{
										bool flag = true;
										text2 = null;
										text2 = streamReader.ReadLine();
										this.SetStatus("HEL" + text2);
									}
									while (!(text2.Substring(3, 1) == " "));
									streamWriter.WriteLine("AUTH LOGIN");
									streamWriter.Flush();
									string str2 = streamReader.ReadLine();
									this.SetStatus("AUTH" + str2);
									streamWriter.WriteLine(FormMainNaverAuthSmtp.Base64Encode(this.m_smtpID, Encoding.UTF8));
									streamWriter.Flush();
									string str3 = streamReader.ReadLine();
									this.SetStatus("ID" + str3);
									streamWriter.WriteLine(FormMainNaverAuthSmtp.Base64Encode(this.m_smtpPW, Encoding.UTF8));
									streamWriter.Flush();
									string text3 = streamReader.ReadLine();
									this.SetStatus("PW" + text3);
									if (!text3.StartsWith("235"))
									{
										this.SetStatus("계정인증실패");
										goto IL_054d;
									}
									streamWriter.WriteLine("Mail From: " + this.RandomExecute(this.m_mailFrom));
									streamWriter.Flush();
									string text4 = streamReader.ReadLine();
									this.SetStatus("MF" + text4);
									if (!text4.StartsWith("250"))
									{
										this.SetStatus("mailFrom에러");
										goto IL_054d;
									}
									string nextMaillist = this.GetNextMaillist(this.m_DongBong);
									int num = 0;
									nextMaillist.TrimStart();
									nextMaillist.TrimEnd();
									string[] array = nextMaillist.Split(',');
									num = array.Length;
									int num2 = 0;
									string[] array2 = array;
									foreach (string text5 in array2)
									{
										streamWriter.WriteLine("Rcpt To: " + text5);
										streamWriter.Flush();
										string text6 = streamReader.ReadLine();
										this.SetStatus("MT" + text6);
										if (text6.StartsWith("2"))
										{
											num2++;
										}
										else if (text6.StartsWith("4") || text6.StartsWith("5"))
										{
											str = str + " " + text5;
										}
										else if (!text6.Contains("250") || !text6.Contains("550") || !text6.Contains("553") || !text6.Contains("552") || !text6.Contains("551") || !text6.Contains("450") || !text6.Contains("451"))
										{
											this.SetStatus("err! RCPT :" + text6);
											break;
										}
									}
									if (num2 != 0)
									{
										goto IL_03d2;
									}
									goto IL_03d2;
								IL_03d2:
									streamWriter.WriteLine("DATA");
									streamWriter.Flush();
									string str4 = streamReader.ReadLine();
									this.SetStatus("DA" + str4);
									streamWriter.WriteLine("From: " + this.m_fromName + " <" + this.m_mailFrom + ">");
									streamWriter.Flush();
									streamWriter.WriteLine("Subject: sdfsdfsdf");
									streamWriter.Flush();
									streamWriter.WriteLine("Content-Type: text/html");
									streamWriter.Flush();
									streamWriter.WriteLine("MIME-Version: 1.0");
									streamWriter.Flush();
									streamWriter.WriteLine("Content-Type: charset=\"utf-7\"");
									streamWriter.Flush();
									streamWriter.WriteLine("Content-Transfer-Encoding: 7bit");
									streamWriter.Flush();
									streamWriter.WriteLine("X-Mailer: ");
									streamWriter.Flush();
									streamWriter.WriteLine("X-MimeOLE:  Produced By Microsoft MimeOLE V6.1.7601.1760\r\n");
									streamWriter.Flush();
									streamWriter.WriteLine(this.m_body + "\r\n");
									streamWriter.Flush();
									streamWriter.WriteLine("\r\n.\r\n");
									streamWriter.Flush();
									string str5 = streamReader.ReadLine();
									this.SetStatus("RE" + str5);
									streamWriter.WriteLine("quit \r\n");
									streamWriter.Flush();
									goto IL_054d;
								IL_054d:
									sslStream.Close();
									networkStream.Close();
									tcpClient.Close();
								}
							}
						}
					}
				}
			}
			catch (Exception ex)
			{
				this.SetStatus(ex.Message);
			}
		}

		public static string Base64Encode(string src, Encoding enc)
		{
			byte[] bytes = enc.GetBytes(src);
			return Convert.ToBase64String(bytes);
		}

		public static string Base64Decode(string src, Encoding enc)
		{
			byte[] bytes = Convert.FromBase64String(src);
			return enc.GetString(bytes);
		}

		private void StartThread(object threadNum)
		{
			HttpWeb httpWeb = new HttpWeb();
			Dictionary<string, string> dictionary = new Dictionary<string, string>();
			Dictionary<string, string> dictionary2 = new Dictionary<string, string>();
			string text = "";
			bool flag = false;
			int num = 0;
			int num2 = 0;
			int num3 = 0;
			int num4 = Convert.ToInt32(threadNum);
			int num5 = 0;
			Random random = new Random();
			this.m_autoPauseCount = 0;
			int m_eashMailNumCount = 0;
			while (true)
			{
				bool flag2 = true;
				try
				{
					this.UpdateDataResult();
					string url = "";
					string text2 = "";
					string text3 = "";
					string text4 = "";
					string value = "";
					int num6 = 0;
					string text5 = "";
					lock (FormMainNaverAuthSmtp.QueueLock)
					{
						if (this.m_autoPauseCount >= this.m_autoPause)
						{
							var vpsUrl = GetUrl(url, UrlType.VpsUrl);
							if (this.m_isFixedServer && !string.IsNullOrEmpty(vpsUrl))
							{
								var vpsResult = VpsHelper.GetInstance().ChangeIp(vpsUrl);
								if (!vpsResult)
								{
									this.SetStatus("[" + num4.ToString() + "]자동정지(" + this.m_countTask.ToString() + ")");
									this.SaveLogA("로그\\vps.txt", vpsUrl + "无可用IP\r\n");
									this.m_countTask++;
									this.CtrlStop();
									return;
								}
							}
							else
							{
								this.SetStatus("[" + num4.ToString() + "]자동정지(" + this.m_countTask.ToString() + ")");
								this.m_countTask++;
								this.CtrlStop();
								return;
							}
						}
						if (this.m_pause)
						{
							this.SetStatus("[" + num4.ToString() + "]일시정지(" + this.m_countTask.ToString() + ")");
							this.m_countTask++;
							this.CtrlStop();
							return;
						}
						if (this.checkBox_maillistAutoStop.Checked && this.m_maillistCur >= this.m_maillistTotal)
						{
							this.SetStatus("[" + num4.ToString() + "]리스트모두사용(" + this.m_countTask.ToString() + ")");
							this.m_countTask++;
							this.CtrlStop();
							return;
						}
						if (this.checkBox_accountAutoStop.Checked && this.m_accountCur >= this.m_accountTotal)
						{
							this.SetStatus("[" + num4.ToString() + "]계정모두사용(" + this.m_countTask.ToString() + ")");
							this.m_countTask++;
							this.CtrlStop();
							return;
						}
						if (this.m_oneShot)
						{
							this.m_pause = true;
						}
						if (this.m_serverOnlyone.Length > 0)
						{
							url = this.m_serverOnlyone;
						}
						else if (this.m_isFixedServer)
						{
							if (num2 == 0)
							{
								url = this.GetNextServer();
								num2++;
							}
						}
						else
						{
							url = this.GetNextServer();
						}
						text2 = GetUrl(url, UrlType.MailUrl);
						if (this.m_isFixedServer && m_eashMailNumCount >= this.m_eachMailNum)
						{
							var vpsUrl = GetUrl(url, UrlType.VpsUrl);
							if (!string.IsNullOrEmpty(vpsUrl))
							{
								var vpsResult = VpsHelper.GetInstance().ChangeIp(vpsUrl);
								if (!vpsResult)
								{
									this.SaveLogA("로그\\vps.txt", vpsUrl + "无可用IP\r\n");
								}
								else
								{
									m_eashMailNumCount = 0;
								}
							}
						}

						if (this.m_isUseAccount)
						{
							if (this.m_sendLimitAccountCount >= this.m_sendLimitAccount && !this.m_isDoingClientWithServer)
							{
								this.NextAccountForTextBox();
								if (this.m_isDoingListener && this.checkBox_isSendSameAccount.Checked)
								{
									this.button_sendAccount.PerformClick();
								}
								this.m_sendLimitAccountCount = 0;
							}
							if (this.m_smtpID.Length > 0 && this.m_smtpPW.Length > 0)
							{
								text3 = this.m_smtpID + " " + this.m_smtpPW;
							}
							else if (this.m_isFixedAccount)
							{
								if (num3 == 0)
								{
									text3 = this.GetNextAccount();
									num3++;
								}
							}
							else
							{
								text3 = this.GetNextAccount();
							}
						}
						if (!this.m_oneShot)
						{
							if (flag && this.checkBox_isRecycleList.Checked)
							{
								flag = false;
								text4 = text;
							}
							else if (this.checkBox_rndDongbong.Checked && this.m_rndDongBongMin >= 0 && this.m_rndDongBongMax >= 0 && this.m_rndDongBongMin < this.m_rndDongBongMax)
							{
								num5 = random.Next(this.m_rndDongBongMin, this.m_rndDongBongMax);
								text4 = this.GetNextMaillist(num5);
							}
							else
							{
								num5 = this.m_DongBong;
								text4 = this.GetNextMaillist(this.m_DongBong);
							}
							if (this.checkBox_rndDongbong.Checked)
							{
								this.m_sendLimitAccountCount += num5;
							}
							this.m_sendLimitAccountCount += this.m_DongBong;
						}
						else
						{
							text4 = this.m_testAccount;
							if (text4.Contains(","))
							{
								string[] array = text4.Split(',');
								num6 = array.Length;
							}
							else
							{
								num6 = 1;
							}
						}
						if (this.checkBox_isUseBcc.Checked)
						{
							value = this.GetNextBcc(this.m_Bcc);
						}
					}
					if (text2 == null)
					{
						this.SetStatus("서버없음");
						num2 = 0;
						goto end_IL_0045;
					}
					if (this.m_isUseAccount && text3 == null)
					{
						this.SetStatus("계정없음");
						num3 = 0;
						goto end_IL_0045;
					}
					if (text4 == null)
					{
						this.SetStatus("리스트없음");
						goto end_IL_0045;
					}
					dictionary.Clear();
					dictionary2.Clear();
					dictionary = httpWeb.GetDefaultHeader();
					string text6 = "";
					if (this.m_isUseAccount && !string.IsNullOrEmpty(text3))
					{
						int num7 = 0;
						text3.TrimStart();
						text3.TrimEnd();
						string[] array2 = text3.Split(' ');
						num7 = array2.Length;
						if (num7 >= 2)
						{
							dictionary2.Add("smtpID", array2[0]);
							dictionary2.Add("SmtpUserID", array2[0]);
							dictionary2.Add("smtpPW", array2[1]);
							dictionary2.Add("SmtpUserPW", array2[1]);
							text6 = array2[0];
							goto IL_06c5;
						}
						this.SetStatus("계정분리오류");
						this.SaveLogA("계정분리오류.txt", text3 + "\r\n");
						num3 = 0;
						text = text4;
						flag = true;
						goto end_IL_0045;
					}
					goto IL_06c5;
				IL_06c5:
					if (this.m_isUseAccount)
					{
						if (this.m_oldID == text6)
						{
							dictionary2.Add("helo", this.m_fixedHelo);
						}
						else
						{
							this.m_oldID = text6;
							this.m_fixedHelo = this.RandomExecute(this.m_helo);
							dictionary2.Add("helo", this.m_fixedHelo);
						}
					}
					else
					{
						dictionary2.Add("helo", this.RandomExecute(this.m_helo));
					}
					if (this.m_isUseAccount)
					{
						string value2 = (!(this.m_smtpServer == "smtp.naver.com")) ? ((!(this.m_smtpServer == "smtp.daum.net")) ? ((!(this.m_smtpServer == "smtp.hanmail.net")) ? ((!(this.m_smtpServer == "smtp.mail.nate.com")) ? this.RandomExecute(this.m_mailFrom) : (text6 + "@nate.com")) : (text6 + "@hanmail.net")) : (text6 + "@daum.net")) : (text6 + "@naver.com");
						dictionary2.Add("mailFrom", value2);
					}
					else
					{
						dictionary2.Add("mailFrom", this.RandomExecute(this.m_mailFrom));
					}
					if (this.m_oneShot)
					{
						dictionary2.Add("dongbo", num6.ToString());
					}
					else if (this.checkBox_rndDongbong.Checked)
					{
						dictionary2.Add("dongbo", num5.ToString());
					}
					else
					{
						dictionary2.Add("dongbo", this.m_DongBong.ToString());
					}
					dictionary2.Add("mailTo", text4);
					if (this.checkBox_isUseBcc.Checked)
					{
						dictionary2.Add("bcc", value);
					}
					dictionary2.Add("subject", this.RandomExecute(this.m_subject));
					dictionary2.Add("fromName", this.RandomExecute(this.m_fromName));
					dictionary2.Add("xmailer", this.RandomExecute(this.m_xmailer));
					dictionary2.Add("body", this.RandomExecute(this.m_body));
					if (this.m_isUseAttach)
					{
						dictionary2.Add("AttSize", this.m_attachSize.ToString());
						dictionary2.Add("fileTitle", this.RandomExecute(this.m_attachSubject));
						dictionary2.Add("fileContents", this.RandomExecute(this.m_attachBody));
					}
					dictionary2.Add("server", this.m_smtpServer);
					dictionary2.Add("SmtpServer", this.m_smtpServer);
					dictionary2.Add("port", this.m_smtpPort.ToString());
					dictionary2.Add("SmtpPort", this.m_smtpPort.ToString());
					if (this.m_isSSL)
					{
						dictionary2.Add("is_ssl", "ssl");
					}
					string text7 = default(string);
					string text8 = httpWeb.Navigate(text2, dictionary, dictionary2, out text7, out text5);
					if (this.Left(text8, 3) == "오류!")
					{
						this.SetStatus("[" + num4.ToString() + "] " + text8);
					}
					string text9 = text5;
					if (this.Left(text9, 3) == "ok!")
					{
						if (this.checkBox_rndDongbong.Checked)
						{
							this.SetStatus("[" + num5.ToString() + "] " + text9);
						}
						else
						{
							this.SetStatus("[" + num4.ToString() + "] " + text9);
						}
						if (this.m_oneShot)
						{
							this.m_suc++;
						}
						else if (this.checkBox_rndDongbong.Checked)
						{
							this.m_suc += num5;
						}
						else
						{
							this.m_suc += this.m_DongBong;
						}
						flag = false;
						this.m_autoPauseCount = 0;
						if (text9.Length > 3)
						{
							this.DeadListAnalyze(text9);
						}
					}
					else if (this.Left(text9, 20) == "err! socketopen null")
					{
						this.SetStatus("smtp서버접속실패");
						this.SaveLogA("로그\\smtp서버접속실패.txt", text2 + "\r\n");
						if (this.m_oneShot)
						{
							this.m_fail++;
						}
						else if (this.checkBox_rndDongbong.Checked)
						{
							this.m_fail += num5;
						}
						else
						{
							this.m_fail += this.m_DongBong;
						}
						this.m_autoPauseCount++;
						text = text4;
						flag = true;
					}
					else if (this.Left(text9, 13) == "Login Failed:")
					{
						this.SetStatus("계정인증실패-설정다시확인");
						this.SaveLogA("로그\\계정인증실패.txt", text3 + "\r\n");
						this.SaveLogA("로그\\계정인증실패메세지.txt", text9 + "\r\n");
						if (this.m_oneShot)
						{
							this.m_fail++;
						}
						else if (this.checkBox_rndDongbong.Checked)
						{
							this.m_fail += num5;
						}
						else
						{
							this.m_fail += this.m_DongBong;
						}
						this.m_autoPauseCount++;
						text = text4;
						flag = true;
					}
					else
					{
						this.SetStatus("[" + num4.ToString() + "] " + text9);
						if (this.m_oneShot)
						{
							this.m_err++;
						}
						else if (this.checkBox_rndDongbong.Checked)
						{
							this.m_err += num5;
						}
						else
						{
							this.m_err += this.m_DongBong;
						}
						this.m_autoPauseCount++;
						this.SaveLogA("로그\\오류결과저장.txt", "[" + num4.ToString() + "] " + text3 + "\r\n" + text9 + "\r\n\r\n");
						if (num >= 2)
						{
							flag = false;
							num = 0;
						}
						else
						{
							text = text4;
							flag = true;
							num++;
						}
					}
					m_eashMailNumCount++;
					this.UpdateDataResult();
					if (!this.m_oneShot)
					{
						Thread.Sleep(this.m_sendDelay * 1000);
					}
				end_IL_0045:;
				}
				catch (Exception ex)
				{
					this.SetStatus("뻥쟁이");
					this.SaveLogA("로그\\뻥쟁이발송중.txt", ex.StackTrace + "  " + ex.Message + "\r\n");
				}
			}
		}

		private string GetUrl(string url, UrlType urlType)
		{
			if (!url.Contains(Consts.UrlSplitStr))
			{
				return urlType == UrlType.MailUrl ? url : string.Empty;
			}
			var urlPart = url.Split(new string[] { Consts.UrlSplitStr }, StringSplitOptions.RemoveEmptyEntries);
			if (urlPart.Length <= 1)
			{
				return urlType == UrlType.MailUrl ? urlPart[0] : string.Empty;
			}
			return urlType == UrlType.MailUrl ? urlPart[0] : urlPart[1];
		}

		private void DeadListAnalyze(string result)
		{
			string text = null;
			string[] array = result.Split(' ');
			int num = array.Length;
			for (int i = 1; i < array.Length; i++)
			{
				text = text + array[i] + "\r\n";
			}
			this.SaveLogA("없거나휴면인메일.txt", text);
		}

		private void StartSettingSmtp()
		{
			HttpWeb httpWeb = new HttpWeb();
			Dictionary<string, string> dictionary = new Dictionary<string, string>();
			Dictionary<string, string> dictionary2 = new Dictionary<string, string>();
			object queueLock = default(object);
			while (this.m_accountCur < this.m_accountTotal)
			{
				try
				{
					this.UpdateDataResult();
					string text = "";
					string text2 = "";
					bool flag = false;
					try
					{
						Monitor.Enter(queueLock = FormMainNaverAuthSmtp.QueueLock, ref flag);
						text = this.GetNextServer();
						text2 = this.GetNextAccount();
					}
					finally
					{
						if (flag)
						{
							Monitor.Exit(queueLock);
						}
					}
					text = GetUrl(text, UrlType.MailUrl);
					if (text == null)
					{
						this.SetStatus("서버없음");
					}
					else if (text2 == null)
					{
						this.SetStatus("계정없음");
					}
					else
					{
						dictionary.Clear();
						dictionary2.Clear();
						dictionary = httpWeb.GetDefaultHeader();
						string text3 = "";
						string text4 = "";
						int num = 0;
						text2.TrimStart();
						text2.TrimEnd();
						string[] array = text2.Split(' ');
						num = array.Length;
						if (num >= 2)
						{
							text3 = array[0];
							text4 = array[1];
							dictionary2.Add("smtpID", text3);
							dictionary2.Add("smtpPW", text4);
							dictionary2.Add("is_settingsmtp", "settingsmtp");
							dictionary2.Add("server", this.m_smtpServer);
							dictionary2.Add("seturl4", "http://mail.naver.com/json/option/smtp/set/");
							dictionary2.Add("setpost4", "status=true&usePop3Smtp=fromNow&useReadMark=true&includePop3Saved=false&saveOriginal=true&u=" + text3);
							string text5 = default(string);
							string text6 = default(string);
							httpWeb.Navigate(text, dictionary, dictionary2, out text5, out text6);
							string outerHtml = this.GetOuterHtml(httpWeb);
							if (this.Left(outerHtml, 10) == "err! login")
							{
								this.m_fail++;
								this.SetStatus("로그인실패");
								this.SaveLogA("로그\\로그인실패소스.txt", outerHtml + "\r\n\r\n");
								this.SaveLogA("로그인실패.txt", text3 + " " + text4 + "\r\n");
							}
							else if (this.Left(outerHtml, 12) == "err! seturl4")
							{
								this.m_fail++;
								this.SetStatus("smtp설정실패");
								this.SaveLogA("로그\\smtp설정실패소스.txt", outerHtml + "\r\n\r\n");
								this.SaveLogA("smtp설정실패.txt", text3 + " " + text4 + "\r\n");
							}
							else if (this.Left(outerHtml, 17) == "err! input server")
							{
								this.m_fail++;
								this.SetStatus("smtp서버를 입력하세요");
							}
							else if (this.Left(outerHtml, 3) == "ok!")
							{
								this.m_suc++;
								this.SetStatus("ok!");
								this.SaveLogA("smtp설정성공계정.txt", text3 + " " + text4 + "\r\n");
							}
							else
							{
								this.m_err++;
								this.SetStatus("smtp설정오류");
								this.SaveLogA("로그\\smtp설정오류소스.txt", outerHtml + "\r\n\r\n");
								this.SaveLogA("smtp설정오류.txt", text3 + " " + text4 + "\r\n");
							}
							this.UpdateDataResult();
							if (this.m_pause)
							{
								bool flag2 = false;
								try
								{
									Monitor.Enter(queueLock = FormMainNaverAuthSmtp.QueueLock, ref flag2);
									this.SetStatus("일시정지(" + this.m_countTask.ToString() + ")");
									this.m_countTask++;
									this.CtrlStop();
								}
								finally
								{
									if (flag2)
									{
										Monitor.Exit(queueLock);
									}
								}
								break;
							}
						}
						else
						{
							this.SetStatus("계정분리오류");
							this.SaveLogA("계정분리오류.txt", text2 + "\r\n");
						}
					}
				}
				catch (Exception ex)
				{
					this.SaveLogA("로그\\뻥쟁이계정셋팅.txt", ex.StackTrace + "  " + ex.Message + "\r\n");
				}
			}
			if (!this.m_pause)
			{
				bool flag3 = false;
				try
				{
					Monitor.Enter(queueLock = FormMainNaverAuthSmtp.QueueLock, ref flag3);
					this.SetStatus("작업완료(" + this.m_countTask.ToString() + ")");
					this.m_countTask++;
					this.CtrlStop();
				}
				finally
				{
					if (flag3)
					{
						Monitor.Exit(queueLock);
					}
				}
			}
		}

		private void StartCheckSocket()
		{
			HttpWeb httpWeb = new HttpWeb();
			if (this.listServer == null)
			{
				MessageBox.Show("우표서버를 입력하세요");
			}
			else if (this.m_smtpPort.ToString().Length == 0)
			{
				MessageBox.Show("smtp포트를 입력하세요");
			}
			else if (this.m_smtpServer.Length == 0)
			{
				MessageBox.Show("smtp서버를 입력하세요");
			}
			else
			{
				Dictionary<string, string> dictionary = new Dictionary<string, string>();
				Dictionary<string, string> dictionary2 = new Dictionary<string, string>();
				object queueLock = default(object);
				while (this.m_serverCur < this.m_serverTotal)
				{
					this.UpdateDataResult();
					try
					{
						dictionary.Clear();
						dictionary2.Clear();
						dictionary = httpWeb.GetDefaultHeader();
						string text = "";
						bool flag = false;
						try
						{
							Monitor.Enter(queueLock = FormMainNaverAuthSmtp.QueueLock, ref flag);
							text = this.GetNextServer();
						}
						finally
						{
							if (flag)
							{
								Monitor.Exit(queueLock);
							}
						}
						text = GetUrl(text, UrlType.MailUrl);
						dictionary2.Add("server", this.m_smtpServer);
						dictionary2.Add("port", this.m_smtpPort.ToString());
						if (this.m_isSSL)
						{
							dictionary2.Add("is_ssl", "ssl");
						}
						dictionary2.Add("is_checkSocket", "checkSocket");
						string text2 = default(string);
						string text3 = default(string);
						httpWeb.Navigate(text, dictionary, dictionary2, out text2, out text3);
						string outerHtml = this.GetOuterHtml(httpWeb);
						if (outerHtml == "sock ok!")
						{
							this.m_suc++;
							this.SetStatus("접속ok");
							this.SaveLogA("smtp접속성공서버.txt", text + "\r\n");
						}
						else
						{
							this.m_fail++;
							this.SetStatus(outerHtml);
							this.SaveLogA("로그\\smtp접속실패.txt", outerHtml + "\r\n");
						}
						this.UpdateDataResult();
						if (this.m_pause)
						{
							bool flag2 = false;
							try
							{
								Monitor.Enter(queueLock = FormMainNaverAuthSmtp.QueueLock, ref flag2);
								this.SetStatus("일시정지(" + this.m_countTask.ToString() + ")");
								this.m_countTask++;
								this.CtrlStop();
							}
							finally
							{
								if (flag2)
								{
									Monitor.Exit(queueLock);
								}
							}
							break;
						}
					}
					catch (Exception ex)
					{
						this.SaveLogA("로그\\뻥쟁이checksock.txt", ex.StackTrace + "  " + ex.Message + "\r\n");
					}
				}
				if (!this.m_pause)
				{
					bool flag3 = false;
					try
					{
						Monitor.Enter(queueLock = FormMainNaverAuthSmtp.QueueLock, ref flag3);
						this.SetStatus("작업완료(" + this.m_countTask.ToString() + ")");
						this.m_countTask++;
						this.CtrlStop();
					}
					finally
					{
						if (flag3)
						{
							Monitor.Exit(queueLock);
						}
					}
				}
			}
		}

		private void button_start_Click(object sender, EventArgs e)
		{
			this.StartClick();
			this.SetStatus("발송시작");
		}

		private void StartClick()
		{
			if (this.m_isDoingListener && MessageBox.Show("쫄병도 발송하시겠습니까?", "전체발송인지 확인", MessageBoxButtons.YesNo) == DialogResult.Yes)
			{
				this.broadcast("[%START%]");
			}
			this.CtrlStart();
			this.m_pause = false;
			this.m_oneShot = false;
			this.m_countTask = 1;
			int num = 0;
			int num2 = 0;
			if (this.m_isCheckSocket)
			{
				if (MessageBox.Show("    설정탭에 smtp포트 , smtp서버 , SSL사용\n\n              확실하게 체크하셨습니까?", "한번더 확인", MessageBoxButtons.YesNo) == DialogResult.Yes)
				{
					num = this.m_serverTotal - this.m_serverCur;
					num2 = ((num >= this.m_thread) ? this.m_thread : num);
					for (int i = 0; i < num2; i++)
					{
						Task task = Task.Factory.StartNew(delegate
						{
							this.StartCheckSocket();
						});
					}
				}
			}
			else if (this.m_isAccountSettingSmtp)
			{
				num = this.m_accountTotal - this.m_accountCur;
				num2 = ((num >= this.m_thread) ? this.m_thread : num);
				for (int i = 0; i < num2; i++)
				{
					Task task = Task.Factory.StartNew(delegate
					{
						this.StartSettingSmtp();
					});
				}
			}
			else
			{
				num2 = this.m_thread;
				for (int i = 0; i < num2; i++)
				{
					Task.Factory.StartNew(this.StartThread, i + 1);
				}
			}
		}

		private void button_oneShot_Click(object sender, EventArgs e)
		{
			this.OneShot();
			this.SetStatus("한통발송");
		}

		private void OneShot()
		{
			this.m_oneShot = true;
			this.m_pause = false;
			Task task = Task.Factory.StartNew(delegate
			{
				this.StartThread(1);
			});
		}

		private void iam_boss(int port)
		{
			this.listSocketTcpClient = new List<TcpClient>();
			this.button_sendFixedData.Enabled = true;
			this.button_sendAccount.Enabled = true;
			this.button_sendServer.Enabled = true;
			this.checkBox_isSendSameAccount.Enabled = true;
			this.checkBox_isSendSameServer.Enabled = true;
			this.button_ontShotAll.Enabled = true;
			this.button_requestAccount.Enabled = false;
			this.button_requestServer.Enabled = false;
			this.EndServer();
			this.EndClient();
			this.CtrlSubStop();
			this.m_isDoingListener = true;
			this.taskListener = Task.Factory.StartNew(delegate
			{
				this.ServerStart(port);
			});
		}

		public void ServerStart(int port)
		{
			try
			{
				this.serverSocket = new TcpListener(IPAddress.Parse("127.0.0.1"), port);
				TcpClient client = null;
				int counter = 0;
				this.serverSocket.Start();
				this.SetStatus("대장켜짐");
				while (this.m_isDoingListener)
				{
					client = this.serverSocket.AcceptTcpClient();
					this.countConnectingClient++;
					this.UpdateDataInvoke(this.label_bossStatus, "쫄병\r\n" + this.countConnectingClient.ToString() + " 접속중");
					this.m_isDoingClientWithServer = true;
					Task task = Task.Factory.StartNew(delegate
					{
						this.startClient(client, counter.ToString());
					});
				}
			}
			catch (Exception)
			{
			}
			finally
			{
				this.SetStatus("대장이 종료되었습니다_리스너");
			}
		}

		public void startClient(TcpClient inClientSocket, string clineNo)
		{
			try
			{
				this.clNo = clineNo;
				NetworkStream stream = inClientSocket.GetStream();
				StreamReader streamReader = new StreamReader(stream);
				StreamWriter streamWriter = new StreamWriter(stream);
				this.listSocketTcpClient.Add(inClientSocket);
				this.SetStatus("쫄병접속");
				string text = null;
				while (this.m_isDoingClientWithServer)
				{
					text = streamReader.ReadLine();
					if (text.Contains("[%서버내놔%]"))
					{
						streamWriter.WriteLine("[%serverOnlyone=" + this.GetNextServer() + "%]\r\n");
						streamWriter.Flush();
					}
					if (text.Contains("[%계정내놔%]"))
					{
						string nextAccount = this.GetNextAccount();
						int num = 0;
						nextAccount.TrimStart();
						nextAccount.TrimEnd();
						string[] array = nextAccount.Split(' ');
						num = array.Length;
						if (num >= 2)
						{
							streamWriter.WriteLine("[%smtpID=" + array[0] + "%]\r\n[%smtpPW=" + array[1] + "%]\r\n");
							streamWriter.Flush();
						}
						else
						{
							this.SetStatus("계정분리오류");
							this.SaveLogA("계정분리오류.txt", nextAccount + "\r\n");
						}
					}
					if (text.Contains("[%연결해제%]"))
					{
						for (int i = 0; i < this.listSocketTcpClient.Count; i++)
						{
							if (this.listSocketTcpClient[i] == inClientSocket)
							{
								this.listSocketTcpClient.RemoveAt(i);
							}
						}
						inClientSocket.Close();
						stream.Close();
					}
				}
			}
			catch (Exception)
			{
			}
			finally
			{
				this.countConnectingClient--;
				this.UpdateDataInvoke(this.label_bossStatus, "쫄병\r\n" + this.countConnectingClient.ToString() + " 접속중");
				this.SetStatus("대장 스레드1개 종료 with쫄병");
			}
		}

		public void broadcast(string msg)
		{
			foreach (TcpClient item in this.listSocketTcpClient)
			{
				if (item.Connected)
				{
					NetworkStream stream = item.GetStream();
					StreamWriter streamWriter = new StreamWriter(stream);
					streamWriter.WriteLine(msg);
					streamWriter.Flush();
				}
			}
		}

		public void broadcastAnother(string msg)
		{
			foreach (TcpClient item in this.listSocketTcpClient)
			{
				string value = null;
				if (item.Connected)
				{
					NetworkStream stream = item.GetStream();
					StreamWriter streamWriter = new StreamWriter(stream);
					if (msg == "계정")
					{
						if (this.checkBox_isSendSameAccount.Checked)
						{
							value = "[%smtpID=" + this.m_smtpID + "%]\r\n";
							value = value + "[%smtpPW=" + this.m_smtpPW + "%]\r\n";
						}
						else
						{
							string nextAccount = this.GetNextAccount();
							int num = 0;
							nextAccount.TrimStart();
							nextAccount.TrimEnd();
							string[] array = nextAccount.Split(' ');
							num = array.Length;
							if (num >= 2)
							{
								value = "[%smtpID=" + array[0] + "%]\r\n[%smtpPW=" + array[1] + "%]\r\n";
							}
							else
							{
								this.SetStatus("계정분리오류");
								this.SaveLogA("계정분리오류.txt", nextAccount + "\r\n");
							}
						}
					}
					if (msg == "서버")
					{
						value = ((!this.checkBox_isSendSameServer.Checked) ? ("[%serverOnlyone=" + this.GetNextServer() + "%]\r\n") : ("[%serverOnlyone=" + this.m_serverOnlyone + "%]\r\n"));
					}
					streamWriter.WriteLine(value);
					streamWriter.Flush();
				}
			}
		}

		public void Connect(int port)
		{
			this.clientSocket = new TcpClient();
			this.serverStream = null;
			try
			{
				this.clientSocket.Connect("127.0.0.1", port);
				this.serverStream = this.clientSocket.GetStream();
				this.SetStatus("대장과 연결되었습니다");
				this.m_isDoingGetMessageWithClient = true;
				Task task = Task.Factory.StartNew(delegate
				{
					this.ClientGetMessage();
				});
			}
			catch (Exception)
			{
				this.SetStatus("대장과 연결실패 쫄병 자동종료");
			}
		}

		public void ClientSend(string data)
		{
			try
			{
				if (this.serverStream != null)
				{
					StreamWriter streamWriter = new StreamWriter(this.serverStream);
					streamWriter.WriteLine(data);
					streamWriter.Flush();
				}
			}
			catch (Exception)
			{
				this.SetStatus("메세지전송실패");
			}
		}

		private void ClientGetMessage()
		{
			try
			{
				this.serverStream = this.clientSocket.GetStream();
				StreamReader streamReader = new StreamReader(this.serverStream);
				while (true)
				{
					if (this.m_isDoingGetMessageWithClient)
					{
						string text = streamReader.ReadLine();
						if (text.Contains("[%START%]"))
						{
							if (this.button_start.Enabled)
							{
								this.StartClick();
							}
							continue;
						}
						if (text.Contains("[%STOP%]"))
						{
							this.PauseClick();
							continue;
						}
						if (!text.Contains("[%연결해제%]"))
						{
							this.ParsingReceiveData(text);
							continue;
						}
						break;
					}
					return;
				}
				this.m_isDoingGetMessageWithClient = false;
			}
			catch (Exception ex)
			{
				this.SetStatus("비정상접속종료 : " + ex.ToString());
			}
			finally
			{
				this.SetStatus("대장과 연결종료");
			}
		}

		public void ParsingReceiveData(string receiveData)
		{
			if (!string.IsNullOrEmpty(receiveData))
			{
				if (this.Left(receiveData, "[%DongBong=".Length) == "[%DongBong=")
				{
					this.m_DongBong = Convert.ToInt32(this.SubStringTrue(receiveData, "[%DongBong=", "%]", 0));
					this.UpdateDataInvoke(this.textBox_dongbong, this.m_DongBong.ToString());
				}
				else if (this.Left(receiveData, "[%thread=".Length) == "[%thread=")
				{
					this.m_thread = Convert.ToInt32(this.SubStringTrue(receiveData, "[%thread=", "%]", 0));
					this.UpdateDataInvoke(this.textBox_thread, this.m_thread.ToString());
				}
				else if (this.Left(receiveData, "[%testAccount=".Length) == "[%testAccount=")
				{
					this.m_testAccount = this.SubStringTrue(receiveData, "[%testAccount=", "%]", 0);
					this.UpdateDataInvoke(this.textBox_testAccount, this.m_testAccount);
				}
				else if (this.Left(receiveData, "[%checkAccount=".Length) == "[%checkAccount=")
				{
					this.m_checkAccount = this.SubStringTrue(receiveData, "[%checkAccount=", "%]", 0);
					this.UpdateDataInvoke(this.textBox_checkAccount, this.m_checkAccount);
				}
				else if (this.Left(receiveData, "[%subject=".Length) == "[%subject=")
				{
					this.m_subject = this.SubStringTrue(receiveData, "[%subject=", "%]", 0);
					this.UpdateDataInvoke(this.richTextBox_subject, this.m_subject);
				}
				else if (this.Left(receiveData, "[%body=".Length) == "[%body=")
				{
					this.m_body = this.SubStringTrue(receiveData, "[%body=", "%]", 0);
					this.m_body = this.m_body.Replace("[$줄바꿈$]", "\r\n");
					this.UpdateDataInvoke(this.richTextBox_body, this.m_body);
				}
				else if (this.Left(receiveData, "[%smtpServer=".Length) == "[%smtpServer=")
				{
					this.m_smtpServer = this.SubStringTrue(receiveData, "[%smtpServer=", "%]", 0);
					this.UpdateDataInvoke(this.textBox_smtpServer, this.m_smtpServer);
				}
				else if (this.Left(receiveData, "[%smtpPort=".Length) == "[%smtpPort=")
				{
					this.m_smtpPort = Convert.ToInt32(this.SubStringTrue(receiveData, "[%smtpPort=", "%]", 0));
					this.UpdateDataInvoke(this.textBox_smtpPort, this.m_smtpPort.ToString());
				}
				else if (this.Left(receiveData, "[%checkDelay=".Length) == "[%checkDelay=")
				{
					this.m_checkDelay = Convert.ToInt32(this.SubStringTrue(receiveData, "[%checkDelay=", "%]", 0));
					this.UpdateDataInvoke(this.textBox_checkDelay, this.m_checkDelay.ToString());
				}
				else if (this.Left(receiveData, "[%mailFrom=".Length) == "[%mailFrom=")
				{
					this.m_mailFrom = this.SubStringTrue(receiveData, "[%mailFrom=", "%]", 0);
					this.UpdateDataInvoke(this.textBox_mailFrom, this.m_mailFrom);
				}
				else if (this.Left(receiveData, "[%xmailer=".Length) == "[%xmailer=")
				{
					this.m_xmailer = this.SubStringTrue(receiveData, "[%xmailer=", "%]", 0);
					this.UpdateDataInvoke(this.textBox_xmailer, this.m_xmailer);
				}
				else if (this.Left(receiveData, "[%sendDelay=".Length) == "[%sendDelay=")
				{
					this.m_sendDelay = Convert.ToInt32(this.SubStringTrue(receiveData, "[%sendDelay=", "%]", 0));
					this.UpdateDataInvoke(this.textBox_sendDelay, this.m_sendDelay.ToString());
				}
				else if (this.Left(receiveData, "[%attachSize=".Length) == "[%attachSize=")
				{
					this.m_attachSize = Convert.ToInt32(this.SubStringTrue(receiveData, "[%attachSize=", "%]", 0));
					this.UpdateDataInvoke(this.textBox_attachSize, this.m_attachSize.ToString());
				}
				else if (this.Left(receiveData, "[%isUseAttach=".Length) == "[%isUseAttach=")
				{
					this.m_isUseAttach = Convert.ToBoolean(this.SubStringTrue(receiveData, "[%isUseAttach=", "%]", 0));
					this.checkBox_isUseAttach.Checked = this.m_isUseAttach;
				}
				else if (this.Left(receiveData, "[%isUseAccount=".Length) == "[%isUseAccount=")
				{
					this.m_isUseAccount = Convert.ToBoolean(this.SubStringTrue(receiveData, "[%isUseAccount=", "%]", 0));
					this.checkBox_isUseAccount.Checked = this.m_isUseAccount;
				}
				else if (this.Left(receiveData, "[%isSSL=".Length) == "[%isSSL=")
				{
					this.m_isSSL = Convert.ToBoolean(this.SubStringTrue(receiveData, "[%isSSL=", "%]", 0));
					this.checkBox_isSSL.Checked = this.m_isSSL;
				}
				else if (this.Left(receiveData, "[%helo=".Length) == "[%helo=")
				{
					this.m_helo = this.SubStringTrue(receiveData, "[%helo=", "%]", 0);
					this.UpdateDataInvoke(this.textBox_helo, this.m_helo);
				}
				else if (this.Left(receiveData, "[%autoPause=".Length) == "[%autoPause=")
				{
					this.m_autoPause = Convert.ToInt32(this.SubStringTrue(receiveData, "[%autoPause=", "%]", 0));
					this.UpdateDataInvoke(this.textBox_autoPause, this.m_autoPause.ToString());
				}
				else if (this.Left(receiveData, "[%eachMailNum=".Length) == "[%eachMailNum=")
				{
					this.m_eachMailNum = Convert.ToInt32(this.SubStringTrue(receiveData, "[%eachMailNum=", "%]", 0));
					this.UpdateDataInvoke(this.textBox_eachMailNum, this.m_eachMailNum.ToString());
				}
				else if (this.Left(receiveData, "[%attachSubject=".Length) == "[%attachSubject=")
				{
					this.m_attachSubject = this.SubStringTrue(receiveData, "[%attachSubject=", "%]", 0);
					this.UpdateDataInvoke(this.textBox_attachSubject, this.m_attachSubject);
				}
				else if (this.Left(receiveData, "[%attachBody=".Length) == "[%attachBody=")
				{
					this.m_attachBody = this.SubStringTrue(receiveData, "[%attachBody=", "%]", 0);
					this.m_attachBody = this.m_attachBody.Replace("[$줄바꿈$]", "\r\n");
					this.UpdateDataInvoke(this.textBox_attachBody, this.m_attachBody);
				}
				else if (this.Left(receiveData, "[%fromName=".Length) == "[%fromName=")
				{
					this.m_fromName = this.SubStringTrue(receiveData, "[%fromName=", "%]", 0);
					this.UpdateDataInvoke(this.textBox_fromName, this.m_fromName);
				}
				else if (this.Left(receiveData, "[%smtpID=".Length) == "[%smtpID=")
				{
					this.m_smtpID = this.SubStringTrue(receiveData, "[%smtpID=", "%]", 0);
					this.UpdateDataInvoke(this.textBox_smtpID, this.m_smtpID);
				}
				else if (this.Left(receiveData, "[%smtpPW=".Length) == "[%smtpPW=")
				{
					this.m_smtpPW = this.SubStringTrue(receiveData, "[%smtpPW=", "%]", 0);
					this.UpdateDataInvoke(this.textBox_smtpPW, this.m_smtpPW);
				}
				else if (this.Left(receiveData, "[%serverOnlyone=".Length) == "[%serverOnlyone=")
				{
					this.m_serverOnlyone = this.SubStringTrue(receiveData, "[%serverOnlyone=", "%]", 0);
					this.UpdateDataInvoke(this.textBox_serverOnlyone, this.m_serverOnlyone);
				}
				else if (this.Left(receiveData, "[%accountAutoStop=".Length) == "[%accountAutoStop=")
				{
					this.checkBox_accountAutoStop.Checked = Convert.ToBoolean(this.SubStringTrue(receiveData, "[%accountAutoStop=", "%]", 0));
				}
				else if (this.Left(receiveData, "[%maillistAutoStop=".Length) == "[%maillistAutoStop=")
				{
					this.checkBox_maillistAutoStop.Checked = Convert.ToBoolean(this.SubStringTrue(receiveData, "[%maillistAutoStop=", "%]", 0));
				}
				else if (this.Left(receiveData, "[%isRecycleList=".Length) == "[%isRecycleList=")
				{
					this.checkBox_isRecycleList.Checked = Convert.ToBoolean(this.SubStringTrue(receiveData, "[%isRecycleList=", "%]", 0));
				}
				else if (this.Left(receiveData, "[%isUseBcc=".Length) == "[%isUseBcc=")
				{
					this.checkBox_isUseBcc.Checked = Convert.ToBoolean(this.SubStringTrue(receiveData, "[%isUseBcc=", "%]", 0));
				}
				else if (this.Left(receiveData, "[%bcc=".Length) == "[%bcc=")
				{
					this.m_Bcc = Convert.ToInt32(this.SubStringTrue(receiveData, "[%bcc=", "%]", 0));
					this.UpdateDataInvoke(this.textBox_bcc, this.m_Bcc.ToString());
				}
				else if (this.Left(receiveData, "[%isUseRndDongbong=".Length) == "[%isUseRndDongbong=")
				{
					this.checkBox_rndDongbong.Checked = Convert.ToBoolean(this.SubStringTrue(receiveData, "[%isUseRndDongbong=", "%]", 0));
				}
				else if (this.Left(receiveData, "[%rndDongbongMin=".Length) == "[%rndDongbongMin=")
				{
					this.m_rndDongBongMin = Convert.ToInt32(this.SubStringTrue(receiveData, "[%rndDongbongMin=", "%]", 0));
					this.UpdateDataInvoke(this.textBox_rndDongbong_min, this.m_rndDongBongMin.ToString());
				}
				else if (this.Left(receiveData, "[%rndDongbongMax=".Length) == "[%rndDongbongMax=")
				{
					this.m_rndDongBongMax = Convert.ToInt32(this.SubStringTrue(receiveData, "[%rndDongbongMax=", "%]", 0));
					this.UpdateDataInvoke(this.textBox_rndDongbong_max, this.m_rndDongBongMax.ToString());
				}
				else if (this.Left(receiveData, "[%useDirect=".Length) == "[%useDirect=")
				{
					this.checkBox_useDirect.Checked = Convert.ToBoolean(this.SubStringTrue(receiveData, "[%useDirect=", "%]", 0));
				}
				else if (this.Left(receiveData, "[%directHeader=".Length) == "[%directHeader=")
				{
					this.m_directHeader = this.SubStringTrue(receiveData, "[%directHeader=", "%]", 0);
					this.m_directHeader = this.m_directHeader.Replace("[$줄바꿈$]", "\r\n");
					this.UpdateDataInvoke(this.richTextBox_directHeader, this.m_directHeader);
				}
				else if (this.Left(receiveData, "[%changeTabpage=".Length) == "[%changeTabpage=")
				{
					string value = this.SubStringTrue(receiveData, "[%changeTabpage=", "%]", 0);
					this.InvokeTabControl(Convert.ToInt32(value));
				}
				else if (this.Left(receiveData, "[%resetResult%]".Length) == "[%resetResult%]")
				{
					this.ResetResult();
				}
				else if (this.Left(receiveData, "[%oneShot%]".Length) == "[%oneShot%]")
				{
					this.OneShot();
				}
			}
		}

		private void UpdateTabIndex()
		{
		}

		private void FormMainNaverAuthSmtp_FormClosing(object sender, FormClosingEventArgs e)
		{
			this.EndServer();
			this.EndClient();
		}

		private void button_sendFixedData_Click(object sender, EventArgs e)
		{
			try
			{
				string str = "[%DongBong=" + this.m_DongBong.ToString() + "%]\r\n";
				str = str + "[%thread=" + this.m_thread.ToString() + "%]\r\n";
				str = str + "[%testAccount=" + this.m_testAccount.ToString() + "%]\r\n";
				str = str + "[%checkAccount=" + this.m_checkAccount + "%]\r\n";
				str = str + "[%subject=" + this.m_subject + "%]\r\n";
				str = str + "[%body=" + this.m_body.Replace("\n", "[$줄바꿈$]") + "%]\r\n";
				str = str + "[%smtpServer=" + this.m_smtpServer.ToString() + "%]\r\n";
				str = str + "[%smtpPort=" + this.m_smtpPort.ToString() + "%]\r\n";
				str = str + "[%checkDelay=" + this.m_checkDelay.ToString() + "%]\r\n";
				str = str + "[%mailFrom=" + this.m_mailFrom + "%]\r\n";
				str = str + "[%xmailer=" + this.m_xmailer + "%]\r\n";
				str = str + "[%sendDelay=" + this.m_sendDelay.ToString() + "%]\r\n";
				str = str + "[%attachSize=" + this.m_attachSize.ToString() + "%]\r\n";
				object obj = str;
				str = obj + "[%isUseAttach=" + this.m_isUseAttach + "%]\r\n";
				obj = str;
				str = obj + "[%isUseAccount=" + this.m_isUseAccount + "%]\r\n";
				obj = str;
				str = obj + "[%isSSL=" + this.m_isSSL + "%]\r\n";
				str = str + "[%helo=" + this.m_helo + "%]\r\n";
				str = str + "[%autoPause=" + this.m_autoPause.ToString() + "%]\r\n";
				str = str + "[%eachMailNum=" + this.m_eachMailNum.ToString() + "%]\r\n";
				str = str + "[%attachSubject=" + this.m_attachSubject + "%]\r\n";
				str = str + "[%fromName=" + this.m_fromName + "%]\r\n";
				obj = str;
				str = obj + "[%accountAutoStop=" + this.checkBox_accountAutoStop.Checked + "%]\r\n";
				obj = str;
				str = obj + "[%maillistAutoStop=" + this.checkBox_maillistAutoStop.Checked + "%]\r\n";
				obj = str;
				str = obj + "[%isUseBcc=" + this.checkBox_isUseBcc.Checked + "%]\r\n";
				obj = str;
				str = obj + "[%bcc=" + this.m_Bcc + "%]\r\n";
				obj = str;
				str = obj + "[%isUseRndDongbong=" + this.checkBox_rndDongbong.Checked + "%]\r\n";
				obj = str;
				str = obj + "[%rndDongbongMin=" + this.m_rndDongBongMin + "%]\r\n";
				obj = str;
				str = obj + "[%rndDongbongMax=" + this.m_rndDongBongMax + "%]\r\n";
				obj = str;
				str = obj + "[%isRecycleList=" + this.checkBox_isRecycleList.Checked + "%]\r\n";
				str = str + "[%attachBody=" + this.m_attachBody.Replace("\r\n", "[$줄바꿈$]") + "%]\r\n";
				obj = str;
				str = obj + "[%useDirect=" + this.checkBox_useDirect.Checked + "%]\r\n";
				str = str + "[%directHeader=" + this.m_directHeader.Replace("\n", "[$줄바꿈$]") + "%]";
				this.broadcast(str);
			}
			catch (Exception ex)
			{
				this.SetStatus(ex.Message);
			}
		}

		private void button_sendAccount_Click(object sender, EventArgs e)
		{
			this.broadcastAnother("계정");
		}

		private void button_sendServer_Click(object sender, EventArgs e)
		{
			this.broadcastAnother("서버");
		}

		private void iam_sub(int port)
		{
			this.button_sendFixedData.Enabled = false;
			this.button_sendAccount.Enabled = false;
			this.button_sendServer.Enabled = false;
			this.checkBox_isSendSameAccount.Enabled = false;
			this.checkBox_isSendSameServer.Enabled = false;
			this.button_ontShotAll.Enabled = false;
			this.button_requestAccount.Enabled = true;
			this.button_requestServer.Enabled = true;
			this.EndServer();
			this.EndClient();
			this.CtrlSubStart();
			this.UpdateDataInvoke(this.label_bossStatus, "쫄병");
			this.UpdateDataInvoke(this.label_view_account, "");
			this.UpdateDataInvoke(this.label_view_server, "");
			this.Connect(port);
		}

		private void button_requestAccount_Click(object sender, EventArgs e)
		{
			this.ClientSend("[%계정내놔%]");
		}

		private void button_requestServer_Click(object sender, EventArgs e)
		{
			this.ClientSend("[%서버내놔%]");
		}

		private void EndServer()
		{
			try
			{
				if (this.listSocketTcpClient != null)
				{
					this.broadcast("[%연결해제%]");
					foreach (TcpClient item in this.listSocketTcpClient)
					{
						item.Close();
					}
				}
				if (this.taskListener != null)
				{
					this.serverSocket.Stop();
				}
			}
			catch
			{
			}
			this.m_isDoingClientWithServer = false;
			this.m_isDoingListener = false;
		}

		private void EndClient()
		{
			try
			{
				if (this.clientSocket != null)
				{
					this.ClientSend("[%연결해제%]");
					this.clientSocket.Close();
					this.serverStream.Close();
				}
			}
			catch
			{
			}
			this.m_isDoingGetMessageWithClient = false;
		}

		private void radioButton_alone_CheckedChanged(object sender, EventArgs e)
		{
			if (this.radioButton_alone.Checked)
			{
				this.button_sendFixedData.Enabled = false;
				this.button_sendAccount.Enabled = false;
				this.button_sendServer.Enabled = false;
				this.checkBox_isSendSameAccount.Enabled = false;
				this.checkBox_isSendSameServer.Enabled = false;
				this.button_requestAccount.Enabled = false;
				this.button_requestServer.Enabled = false;
				this.button_ontShotAll.Enabled = false;
				this.EndServer();
				this.EndClient();
				this.CtrlSubStop();
				this.UpdateDataInvoke(this.label_bossStatus, "독고");
			}
		}

		private void radioButton_boss_CheckedChanged(object sender, EventArgs e)
		{
			if (this.radioButton_boss.Checked)
			{
				this.iam_boss(this.port);
			}
		}

		private void radioButton_boss2_CheckedChanged(object sender, EventArgs e)
		{
			if (this.radioButton_boss2.Checked)
			{
				this.iam_boss(this.port2);
			}
		}

		private void radioButton_boss3_CheckedChanged(object sender, EventArgs e)
		{
			if (this.radioButton_boss3.Checked)
			{
				this.iam_boss(this.port3);
			}
		}

		private void radioButton_sub_CheckedChanged(object sender, EventArgs e)
		{
			if (this.radioButton_sub.Checked)
			{
				this.iam_sub(this.port);
			}
		}

		private void radioButton_sub2_CheckedChanged(object sender, EventArgs e)
		{
			if (this.radioButton_sub2.Checked)
			{
				this.iam_sub(this.port2);
			}
		}

		private void radioButton_sub3_CheckedChanged(object sender, EventArgs e)
		{
			if (this.radioButton_sub3.Checked)
			{
				this.iam_sub(this.port3);
			}
		}

		private string RandomExecute(string text)
		{
			text = text.Replace("[r1]", this.RandomString(1));
			text = text.Replace("[r2]", this.RandomString(2));
			text = text.Replace("[r3]", this.RandomString(3));
			text = text.Replace("[r4]", this.RandomString(4));
			text = text.Replace("[r5]", this.RandomString(5));
			text = text.Replace("[r6]", this.RandomString(6));
			text = text.Replace("[r7]", this.RandomString(7));
			text = text.Replace("[r8]", this.RandomString(8));
			text = text.Replace("[r9]", this.RandomString(9));
			text = text.Replace("[rr]", this.RandomString(this.ReturnSeven(Convert.ToInt32(this.RandomNumber(1)) + 3)));
			text = text.Replace("[rr1]", this.RandomString(this.ReturnSeven(Convert.ToInt32(this.RandomNumber(1)) + 3)));
			text = text.Replace("[k1]", this.RandomStringKor(1));
			text = text.Replace("[k2]", this.RandomStringKor(2));
			text = text.Replace("[k3]", this.RandomStringKor(3));
			text = text.Replace("[k4]", this.RandomStringKor(4));
			text = text.Replace("[k5]", this.RandomStringKor(5));
			text = text.Replace("[k6]", this.RandomStringKor(6));
			text = text.Replace("[k7]", this.RandomStringKor(7));
			text = text.Replace("[k8]", this.RandomStringKor(8));
			text = text.Replace("[k9]", this.RandomStringKor(9));
			text = text.Replace("[kk]", this.RandomStringKor(this.ReturnSeven(Convert.ToInt32(this.RandomNumber(1)) + 3)));
			text = text.Replace("[n1]", this.RandomNumber(1));
			text = text.Replace("[n2]", this.RandomNumber(2));
			text = text.Replace("[n3]", this.RandomNumber(3));
			text = text.Replace("[n4]", this.RandomNumber(4));
			text = text.Replace("[n5]", this.RandomNumber(5));
			text = text.Replace("[n6]", this.RandomNumber(6));
			text = text.Replace("[n7]", this.RandomNumber(7));
			text = text.Replace("[n8]", this.RandomNumber(8));
			text = text.Replace("[n9]", this.RandomNumber(9));
			text = text.Replace("[nn]", this.RandomNumber(this.ReturnSeven(Convert.ToInt32(this.RandomNumber(1)) + 3)));
			return text;
		}

		private int ReturnSeven(int number)
		{
			if (number > 7)
			{
				return 7;
			}
			return number;
		}

		private string RandomString(int length)
		{
			string text = "abcdefghijklmnopqrstuvwxyz1234567890";
			StringBuilder stringBuilder = new StringBuilder(length);
			for (int i = 0; i < length; i++)
			{
				stringBuilder.Append(text[this._random.Next(text.Length)]);
			}
			return stringBuilder.ToString();
		}

		private string RandomNumber(int length)
		{
			string text = "1234567890";
			StringBuilder stringBuilder = new StringBuilder(length);
			for (int i = 0; i < length; i++)
			{
				stringBuilder.Append(text[this._random.Next(text.Length)]);
			}
			return stringBuilder.ToString();
		}

		private string RandomStringKor(int length)
		{
			string str = "김황박이정구고아간공민오우주조정장길감서윤만운봉규찬진전안한홍후어언신입사원평균스펙꽃보다할배최불암";
			str += "힐링캠프가새김원라준박은지사심설국열차평점활동방해유재석변호사변신권영세녹취파일광동제약조선해양현대중공업웅진케미칼매각";
			str += "고명환비만나도계산마기닭갈비무한리필생생정보통축구연산동상어걱정없는답정너대처자세세계최대전갈보디빌더돼지초등생난감한반성문";
			str += "입장바뀐돌고다래커플바파괴자불뿜는디저트만화같은비행기흔한졸업축하봉원뜻왜곡흡연투어에공유지몸살흡연방애연가들의천국분노한";
			str += "보조금폭탄언제터지나탈사출고양이마임이더예뻐결국앤서니퇴출웹화면과비슷하게만들기위해서는폼을이용해서구성하는것보다는";
			str += "서핑중만난고래이신바예바은퇴한국중국증권부동산지도영화뮤직책웹툰프로야구더보기메일카페블로그지식인쇼핑돌파글로벌";
			StringBuilder stringBuilder = new StringBuilder(length);
			for (int i = 0; i < length; i++)
			{
				stringBuilder.Append(str[this._random.Next(str.Length)]);
			}
			return stringBuilder.ToString();
		}

		private void UpdateDataResult()
		{
			this.UpdateDataInvoke(this.label_suc, this.m_suc.ToString());
			this.UpdateDataInvoke(this.label_fail, this.m_fail.ToString());
			this.UpdateDataInvoke(this.label_err, this.m_err.ToString());
		}

		private string GetNextMaillist(int dongbong)
		{
			string text = "";
			for (int i = 0; i < dongbong; i++)
			{
				if (!this.checkBox_maillistAutoStop.Checked && this.m_maillistCur >= this.m_maillistTotal)
				{
					this.m_maillistCur = 0;
				}
				if (this.listMaillist == null || this.listMaillist.Count <= this.m_maillistCur)
				{
					return null;
				}
				if (this.m_checkDelay == this.m_countDelay + 1)
				{
					text = text + this.m_checkAccount + ",";
					this.m_countDelay = 0;
				}
				else
				{
					text = text + this.listMaillist[this.m_maillistCur] + ",";
					this.m_maillistCur++;
					RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
					registryKey.SetValue("maillistCur", this.m_maillistCur);
					this.m_countDelay++;
					this.UpdateDataInvoke(this.textBox_maillistCur, this.m_maillistCur.ToString());
					this.UpdateDataInvoke(this.label_view_mailList, this.m_maillistTotal.ToString() + "\n" + this.m_maillistCur.ToString());
				}
			}
			if (this.Right(text, 1) == ",")
			{
				text = this.Left(text, text.Length - 1);
			}
			return text;
		}

		private string GetNextBcc(int bcc)
		{
			string text = "";
			for (int i = 0; i < bcc; i++)
			{
				if (this.m_bccCur >= this.m_maillistTotal)
				{
					this.m_bccCur = 0;
				}
				if (this.listMaillist == null || this.listMaillist.Count <= this.m_bccCur)
				{
					return null;
				}
				text = text + this.listMaillist[this.m_bccCur] + ",";
				this.m_bccCur++;
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("m_bccCur", this.m_bccCur);
			}
			if (this.Right(text, 1) == ",")
			{
				text = this.Left(text, text.Length - 1);
			}
			return text;
		}

		private string GetNextAccount()
		{
			if (this.m_accountTotal == 0)
			{
				this.SetStatus("계정을 불러오세요");
				return "";
			}
			if (!this.checkBox_accountAutoStop.Checked && this.m_accountCur >= this.m_accountTotal)
			{
				this.m_accountCur = 0;
			}
			if (this.listAccount != null && this.listAccount.Count > this.m_accountCur)
			{
				string result = this.listAccount[this.m_accountCur];
				this.m_accountCur++;
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("accountCur", this.m_accountCur);
				this.UpdateDataInvoke(this.textBox_accountCur, this.m_accountCur.ToString());
				this.UpdateDataInvoke(this.label_view_account, this.m_accountTotal.ToString() + "/" + this.m_accountCur.ToString());
				return result;
			}
			return null;
		}

		private string GetNextServer()
		{
			if (this.m_serverTotal == 0)
			{
				this.SetStatus("서버를 불러오세요");
				return "";
			}
			if (this.m_serverCur >= this.m_serverTotal)
			{
				this.m_serverCur = 0;
			}
			if (this.listServer != null && this.listServer.Count > this.m_serverCur)
			{
				string result = this.listServer[this.m_serverCur];
				this.m_serverCur++;
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("serverCur", this.m_serverCur);
				this.UpdateDataInvoke(this.textBox_serverCur, this.m_serverCur.ToString());
				this.UpdateDataInvoke(this.label_view_server, this.m_serverTotal.ToString() + "/" + this.m_serverCur.ToString());
				return result;
			}
			return null;
		}

		private void button_insertIDPW_Click(object sender, EventArgs e)
		{
			this.NextAccountForTextBox();
		}

		private void NextAccountForTextBox()
		{
			string nextAccount = this.GetNextAccount();
			if (!string.IsNullOrEmpty(nextAccount))
			{
				int num = 0;
				nextAccount.TrimStart();
				nextAccount.TrimEnd();
				string[] array = nextAccount.Split(' ');
				num = array.Length;
				if (num >= 2)
				{
					this.m_smtpID = array[0];
					this.textBox_smtpID.Text = this.m_smtpID;
					this.m_smtpPW = array[1];
					this.textBox_smtpPW.Text = this.m_smtpPW;
				}
				else
				{
					this.SetStatus("계정분리오류");
					this.SaveLogA("계정분리오류.txt", nextAccount + "\r\n");
				}
			}
		}

		private void button_insertServerOnlyone_Click(object sender, EventArgs e)
		{
			this.m_serverOnlyone = this.GetNextServer();
			this.textBox_serverOnlyone.Text = this.m_serverOnlyone;
		}

		private string GetOuterHtml(HttpWeb web)
		{
			try
			{
				return web.Document.DocumentNode.OuterHtml;
			}
			catch
			{
				return "";
			}
		}

		private void SaveLogA(string fileName, string writeData)
		{
			lock (FormMainNaverAuthSmtp.FileLock)
			{
				string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
				this.stream_write = File.AppendText(folderPath + "\\슈퍼맨\\우표발송기\\" + fileName);
				this.stream_write.Write(writeData);
				this.stream_write.Close();
			}
		}

		private void SaveLog(string fileName, string writeData)
		{
			lock (FormMainNaverAuthSmtp.FileLock)
			{
				this.stream_write = new StreamWriter("슈퍼맨\\우표발송기\\" + fileName);
				this.stream_write.Write(writeData);
				this.stream_write.Close();
			}
		}

		private void button_loadAccount_Click(object sender, EventArgs e)
		{
			OpenFileDialog openFileDialog = new OpenFileDialog();
			openFileDialog.Filter = "All Files (*.*)|*.*";
			if (openFileDialog.ShowDialog() == DialogResult.OK)
			{
				this.m_accountTotal = 0;
				this.m_accountCur = 0;
				if (this.listAccount != null)
				{
					this.listAccount.Clear();
				}
				this.listAccount = new List<string>();
				this.stream_read = new StreamReader(openFileDialog.FileName);
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("accountPath", openFileDialog.FileName);
				while (this.stream_read.Peek() > -1)
				{
					string text = this.stream_read.ReadLine().ToString();
					if (text.Length > 0)
					{
						this.listAccount.Add(text);
						this.m_accountTotal++;
					}
				}
				this.label_accountTotal.Text = this.m_accountTotal.ToString();
				this.textBox_accountCur.Text = this.m_accountCur.ToString();
				this.label_accountFileName.Text = Path.GetFileName(openFileDialog.FileName);
				this.stream_read.Close();
			}
		}

		private void button_loadServer_Click(object sender, EventArgs e)
		{
			OpenFileDialog openFileDialog = new OpenFileDialog();
			openFileDialog.Filter = "All Files (*.*)|*.*";
			if (openFileDialog.ShowDialog() == DialogResult.OK)
			{
				this.m_serverTotal = 0;
				this.m_serverCur = 0;
				if (this.listServer != null)
				{
					this.listServer.Clear();
				}
				this.listServer = new List<string>();
				this.stream_read = new StreamReader(openFileDialog.FileName);
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("serverPath", openFileDialog.FileName);
				while (this.stream_read.Peek() > -1)
				{
					string text = this.stream_read.ReadLine().ToString();
					if (text.Length > 0)
					{
						this.listServer.Add(text);
						this.m_serverTotal++;
					}
				}
				this.label_serverTotal.Text = this.m_serverTotal.ToString();
				this.textBox_serverCur.Text = this.m_serverCur.ToString();
				this.label_serverFileName.Text = Path.GetFileName(openFileDialog.FileName);
				this.stream_read.Close();
			}
		}

		private void button_loadMaillist_Click(object sender, EventArgs e)
		{
			OpenFileDialog openFileDialog = new OpenFileDialog();
			openFileDialog.Filter = "All Files (*.*)|*.*";
			if (openFileDialog.ShowDialog() == DialogResult.OK)
			{
				this.m_maillistTotal = 0;
				this.m_maillistCur = 0;
				if (this.listMaillist != null)
				{
					this.listMaillist.Clear();
				}
				this.listMaillist = new List<string>();
				this.stream_read = new StreamReader(openFileDialog.FileName);
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("maillistPath", openFileDialog.FileName);
				while (this.stream_read.Peek() > -1)
				{
					string text = this.stream_read.ReadLine().ToString();
					if (text.Length > 0)
					{
						this.listMaillist.Add(text);
						this.m_maillistTotal++;
					}
				}
				this.label_maillistTotal.Text = this.m_maillistTotal.ToString();
				this.textBox_maillistCur.Text = this.m_maillistCur.ToString();
				this.label_maillistFileName.Text = Path.GetFileName(openFileDialog.FileName);
				this.stream_read.Close();
			}
		}

		private void InItOpen()
		{
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			string text = Convert.ToString(registryKey.GetValue("serverPath"));
			this.m_serverCur = Convert.ToInt32(registryKey.GetValue("serverCur"));
			if (text.Length > 0 && File.Exists(text))
			{
				this.listServer = new List<string>();
				this.stream_read = new StreamReader(text);
				while (this.stream_read.Peek() > -1)
				{
					string text2 = this.stream_read.ReadLine().ToString();
					if (text2.Length > 0)
					{
						this.listServer.Add(text2);
						this.m_serverTotal++;
					}
				}
				if (this.m_serverCur > this.m_serverTotal)
				{
					this.m_serverCur = 0;
				}
				this.label_serverTotal.Text = this.m_serverTotal.ToString();
				this.textBox_serverCur.Text = this.m_serverCur.ToString();
				this.label_serverFileName.Text = Path.GetFileName(text);
				this.stream_read.Close();
			}
			string text3 = Convert.ToString(registryKey.GetValue("accountPath"));
			this.m_accountCur = Convert.ToInt32(registryKey.GetValue("accountCur"));
			if (text3.Length > 0 && File.Exists(text3))
			{
				this.listAccount = new List<string>();
				this.stream_read = new StreamReader(text3);
				while (this.stream_read.Peek() > -1)
				{
					string text2 = this.stream_read.ReadLine().ToString();
					if (text2.Length > 0)
					{
						this.listAccount.Add(text2);
						this.m_accountTotal++;
					}
				}
				if (this.m_accountCur > this.m_accountTotal)
				{
					this.m_accountCur = 0;
				}
				this.label_accountTotal.Text = this.m_accountTotal.ToString();
				this.textBox_accountCur.Text = this.m_accountCur.ToString();
				this.label_accountFileName.Text = Path.GetFileName(text3);
				this.stream_read.Close();
			}
			string text4 = Convert.ToString(registryKey.GetValue("maillistPath"));
			this.m_maillistCur = Convert.ToInt32(registryKey.GetValue("maillistCur"));
			if (text4.Length > 0 && File.Exists(text4))
			{
				this.listMaillist = new List<string>();
				this.stream_read = new StreamReader(text4);
				while (this.stream_read.Peek() > -1)
				{
					string text2 = this.stream_read.ReadLine().ToString();
					if (text2.Length > 0)
					{
						this.listMaillist.Add(text2);
						this.m_maillistTotal++;
					}
				}
				if (this.m_maillistCur > this.m_maillistTotal)
				{
					this.m_maillistCur = 0;
				}
				this.label_maillistTotal.Text = this.m_maillistTotal.ToString();
				this.textBox_maillistCur.Text = this.m_maillistCur.ToString();
				this.label_maillistFileName.Text = Path.GetFileName(text4);
				this.stream_read.Close();
			}
		}

		public void InvokeTabControl(int tabIndex)
		{
			if (this.tabControl1.InvokeRequired)
			{
				DlgInvokeTabContol method = this.InvokeTabControl;
				this.tabControl1.Invoke(method, tabIndex);
			}
			else
			{
				this.tabControl1.SelectedIndex = tabIndex;
			}
		}

		public void UpdateDataInvoke(Control ctr, string strText)
		{
			if (ctr.InvokeRequired)
			{
				DlgInvokeCtrUpdate method = this.UpdateDataInvoke;
				ctr.Invoke(method, ctr, strText);
			}
			else
			{
				ctr.Text = strText;
			}
		}

		private string SubStringTrue(string htmlsource, string start, string end, int index)
		{
			int num = 0;
			int num2 = 0;
			num = htmlsource.IndexOf(start, index, StringComparison.CurrentCultureIgnoreCase);
			if (num == -1)
			{
				return null;
			}
			num2 = htmlsource.IndexOf(end, num, StringComparison.CurrentCultureIgnoreCase);
			if (num2 == -1)
			{
				return null;
			}
			return htmlsource.Substring(num + start.Length, num2 - num - start.Length);
		}

		public string Right(string Text, int TextLength)
		{
			if (Text.Length < TextLength)
			{
				TextLength = Text.Length;
			}
			return Text.Substring(Text.Length - TextLength, TextLength);
		}

		public string Left(string Text, int TextLength)
		{
			if (Text.Length < TextLength)
			{
				TextLength = Text.Length;
			}
			return Text.Substring(0, TextLength);
		}

		public void SetStatus(string strText)
		{
			if (this.listBox_status.InvokeRequired)
			{
				DlgInvokeSetStatus method = this.SetStatus;
				this.listBox_status.Invoke(method, strText);
			}
			else
			{
				if (this.listBox_status.Items.Count > 1000)
				{
					this.listBox_status.Items.RemoveAt(0);
				}
				this.listBox_status.Items.Add(strText);
				int num = this.listBox_status.Height / this.listBox_status.ItemHeight;
				this.listBox_status.TopIndex = this.listBox_status.Items.Count - num;
			}
		}

		private void textBox_accountCur_TextChanged(object sender, EventArgs e)
		{
			try
			{
				this.m_accountCur = Convert.ToInt32(this.textBox_accountCur.Text);
				this.UpdateDataInvoke(this.label_view_account, this.m_accountTotal.ToString() + "/" + this.m_accountCur.ToString());
			}
			catch
			{
				this.textBox_accountCur.Text = "";
			}
		}

		private void textBox_serverCur_TextChanged(object sender, EventArgs e)
		{
			try
			{
				this.m_serverCur = Convert.ToInt32(this.textBox_serverCur.Text);
				this.UpdateDataInvoke(this.label_view_server, this.m_serverTotal.ToString() + "/" + this.m_serverCur.ToString());
			}
			catch
			{
				this.textBox_serverCur.Text = "";
			}
		}

		private void textBox_maillistCur_TextChanged(object sender, EventArgs e)
		{
			try
			{
				this.m_maillistCur = Convert.ToInt32(this.textBox_maillistCur.Text);
				this.UpdateDataInvoke(this.label_view_mailList, this.m_maillistTotal.ToString() + "\n" + this.m_maillistCur.ToString());
			}
			catch
			{
				this.textBox_maillistCur.Text = "";
			}
		}

		private void textBox_smtpID_TextChanged(object sender, EventArgs e)
		{
			this.m_smtpID = this.textBox_smtpID.Text;
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("smtpID", this.m_smtpID);
			if (this.textBox_smtpID.Text.Length > 0)
			{
				this.checkBox_fixedAccount.Checked = false;
			}
		}

		private void textBox_smtpPW_TextChanged(object sender, EventArgs e)
		{
			this.m_smtpPW = this.textBox_smtpPW.Text;
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("smtpPW", this.m_smtpPW);
			if (this.textBox_smtpPW.Text.Length > 0)
			{
				this.checkBox_fixedAccount.Checked = false;
			}
		}

		private void textBox_serverOnlyone_TextChanged(object sender, EventArgs e)
		{
			this.m_serverOnlyone = this.textBox_serverOnlyone.Text;
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("serverOnlyone", this.m_serverOnlyone);
			if (this.textBox_serverOnlyone.Text.Length > 0)
			{
				this.checkBox_fixedServer.Checked = false;
			}
		}

		private void textBox_dongbong_TextChanged(object sender, EventArgs e)
		{
			try
			{
				this.m_DongBong = Convert.ToInt32(this.textBox_dongbong.Text);
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("DongBong", this.m_DongBong);
			}
			catch
			{
				this.textBox_dongbong.Text = "";
			}
		}

		private void textBox_thread_TextChanged(object sender, EventArgs e)
		{
			try
			{
				this.m_thread = Convert.ToInt32(this.textBox_thread.Text);
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("thread", this.m_thread);
			}
			catch
			{
				this.textBox_thread.Text = "";
			}
		}

		private void textBox_autoPause_TextChanged(object sender, EventArgs e)
		{
			try
			{
				this.m_autoPause = Convert.ToInt32(this.textBox_autoPause.Text);
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("autoPause", this.m_autoPause);
			}
			catch
			{
				this.textBox_autoPause.Text = "";
			}
		}

		private void textBox_eachMailNum_TextChanged(object sender, EventArgs e)
		{
			try
			{
				this.m_eachMailNum = Convert.ToInt32(this.textBox_eachMailNum.Text);
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("eachMailNum", this.m_eachMailNum);
			}
			catch
			{
				this.textBox_eachMailNum.Text = "";
			}
		}

		private void textBox_checkDelay_TextChanged(object sender, EventArgs e)
		{
			try
			{
				this.m_checkDelay = Convert.ToInt32(this.textBox_checkDelay.Text);
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("checkDelay", this.m_checkDelay);
			}
			catch
			{
				this.textBox_checkDelay.Text = "";
			}
		}

		private void textBox_checkAccount_TextChanged(object sender, EventArgs e)
		{
			this.m_checkAccount = this.textBox_checkAccount.Text;
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("checkAccount", this.m_checkAccount);
		}

		private void textBox_attachSize_TextChanged(object sender, EventArgs e)
		{
			try
			{
				this.m_attachSize = Convert.ToInt32(this.textBox_attachSize.Text);
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("attachSize", this.m_attachSize);
			}
			catch
			{
				this.textBox_attachSize.Text = "";
			}
		}

		private void textBox_smtpServer_TextChanged(object sender, EventArgs e)
		{
			this.m_smtpServer = this.textBox_smtpServer.Text;
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("smtpServer", this.m_smtpServer);
		}

		private void textBox_smtpPort_TextChanged(object sender, EventArgs e)
		{
			try
			{
				this.m_smtpPort = Convert.ToInt32(this.textBox_smtpPort.Text);
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("smtpPort", this.m_smtpPort);
			}
			catch
			{
				this.textBox_smtpPort.Text = "";
			}
		}

		private void textBox_helo_TextChanged(object sender, EventArgs e)
		{
			this.m_helo = this.textBox_helo.Text;
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("helo", this.m_helo);
		}

		private void textBox_mailFrom_TextChanged(object sender, EventArgs e)
		{
			this.m_mailFrom = this.textBox_mailFrom.Text;
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("mailFrom", this.m_mailFrom);
		}

		private void textBox_mailTo_TextChanged(object sender, EventArgs e)
		{
			this.m_mailTo = this.textBox_mailTo.Text;
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("mailTo", this.m_mailTo);
		}

		private void textBox_fromName_TextChanged(object sender, EventArgs e)
		{
			this.m_fromName = this.textBox_fromName.Text;
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("fromName", this.m_fromName);
		}

		private void textBox_xmailer_TextChanged(object sender, EventArgs e)
		{
			this.m_xmailer = this.textBox_xmailer.Text;
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("xmailer", this.m_xmailer);
		}

		private void richTextBox_subject_TextChanged(object sender, EventArgs e)
		{
			this.m_subject = this.richTextBox_subject.Text;
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("subject", this.m_subject);
		}

		private void richTextBox_body_TextChanged(object sender, EventArgs e)
		{
			this.m_body = this.richTextBox_body.Text;
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("body", this.m_body);
		}

		private void textBox_attachSubject_TextChanged(object sender, EventArgs e)
		{
			this.m_attachSubject = this.textBox_attachSubject.Text;
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("attachSubject", this.m_attachSubject);
		}

		private void textBox_attachBody_TextChanged(object sender, EventArgs e)
		{
			this.m_attachBody = this.textBox_attachBody.Text;
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("attachBody", this.m_attachBody);
		}

		private void checkBox_isUseAttach_CheckedChanged(object sender, EventArgs e)
		{
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			if (this.checkBox_isUseAttach.Checked)
			{
				this.m_isUseAttach = true;
			}
			else
			{
				this.m_isUseAttach = false;
			}
			registryKey.SetValue("isUseAttach", this.m_isUseAttach);
		}

		private void checkBox_isUseAccount_CheckedChanged(object sender, EventArgs e)
		{
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			if (this.checkBox_isUseAccount.Checked)
			{
				this.m_isUseAccount = true;
			}
			else
			{
				this.m_isUseAccount = false;
			}
			registryKey.SetValue("isUseAccount", this.m_isUseAccount);
		}

		private void checkBox_isSSL_CheckedChanged(object sender, EventArgs e)
		{
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			if (this.checkBox_isSSL.Checked)
			{
				this.m_isSSL = true;
			}
			else
			{
				this.m_isSSL = false;
			}
			registryKey.SetValue("isSSL", this.m_isSSL);
		}

		private void button_pause_Click(object sender, EventArgs e)
		{
			this.PauseClick();
		}

		private void PauseClick()
		{
			if (this.m_isDoingListener && MessageBox.Show("쫄병도 정지하시겠습니까?", "전체정지인지 확인", MessageBoxButtons.YesNo) == DialogResult.Yes)
			{
				this.broadcast("[%STOP%]");
			}
			this.m_pause = true;
			this.CtrlStop();
		}

		private void CtrlStart()
		{
			this.button_start.Enabled = false;
			this.button_pause.Enabled = true;
		}

		private void CtrlStop()
		{
			this.button_start.Enabled = true;
			this.button_pause.Enabled = false;
		}

		private void checkBox_isCheckSocket_CheckedChanged(object sender, EventArgs e)
		{
			if (this.checkBox_isCheckSocket.Checked)
			{
				if (this.checkBox_accountSettingSmtp.Checked || this.m_isAccountSettingSmtp)
				{
					this.checkBox_accountSettingSmtp.Checked = false;
					this.m_isAccountSettingSmtp = false;
				}
				this.m_isCheckSocket = true;
				MessageBox.Show("불러오기탭에 우표서버\n\n설정탭에 smtp서버, smtp포트, SSL사용여부\n\n셋팅해 주세요 ", "한번더 확인");
			}
			else
			{
				this.m_isCheckSocket = false;
			}
		}

		private void checkBox_accountSettingSmtp_CheckedChanged(object sender, EventArgs e)
		{
			if (this.checkBox_accountSettingSmtp.Checked)
			{
				if (this.checkBox_isCheckSocket.Checked || this.m_isCheckSocket)
				{
					this.checkBox_isCheckSocket.Checked = false;
					this.m_isCheckSocket = false;
				}
				this.m_isAccountSettingSmtp = true;
				MessageBox.Show("불러오기탭에 우표서버, 계정 \n\n설정탭에 smtp서버\n\n셋팅해 주세요 ", "한번더 확인");
			}
			else
			{
				this.m_isAccountSettingSmtp = false;
			}
		}

		private void button_reset_Click(object sender, EventArgs e)
		{
			if (this.m_isDoingListener)
			{
				this.broadcast("[%resetResult%]");
			}
			this.ResetResult();
		}

		private void ResetResult()
		{
			this.m_suc = 0;
			this.m_fail = 0;
			this.m_err = 0;
			this.UpdateDataResult();
		}

		private void textBox_domain_TextChanged(object sender, EventArgs e)
		{
			this.m_domain = this.textBox_domain.Text;
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("domain", this.m_domain);
		}

		private void textBox_attachBody_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.Control && e.KeyCode == Keys.A)
			{
				this.textBox_attachBody.SelectAll();
			}
		}

		private void textBox_attachSubject_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.Control && e.KeyCode == Keys.A)
			{
				this.textBox_attachSubject.SelectAll();
			}
		}

		private void textBox_sendDelay_TextChanged(object sender, EventArgs e)
		{
			try
			{
				this.m_sendDelay = Convert.ToInt32(this.textBox_sendDelay.Text);
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("sendDelay", this.m_sendDelay);
			}
			catch
			{
				this.textBox_sendDelay.Text = "";
			}
		}

		private void checkBox_fixedServer_CheckedChanged(object sender, EventArgs e)
		{
			if (this.checkBox_fixedServer.Checked)
			{
				this.m_isFixedServer = true;
				this.textBox_serverOnlyone.Text = "";
			}
			else
			{
				this.m_isFixedServer = false;
			}
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("isFixedServer", this.m_isFixedServer);
		}

		private void checkBox_fixedAccount_CheckedChanged(object sender, EventArgs e)
		{
			if (this.checkBox_fixedAccount.Checked)
			{
				this.m_isFixedAccount = true;
				this.textBox_smtpID.Text = "";
				this.textBox_smtpPW.Text = "";
			}
			else
			{
				this.m_isFixedAccount = false;
			}
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("isFixedAccount", this.m_isFixedAccount);
		}

		private void textBox_testAccount_TextChanged(object sender, EventArgs e)
		{
			this.m_testAccount = this.textBox_testAccount.Text;
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("testAccount", this.m_testAccount);
		}

		private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
		{
			if (this.m_isDoingListener)
			{
				this.broadcast("[%changeTabpage=" + this.tabControl1.SelectedIndex.ToString() + "%]");
			}
		}

		private void button_ontShotAll_Click(object sender, EventArgs e)
		{
			if (this.m_isDoingListener)
			{
				this.broadcast("[%oneShot%]");
			}
		}

		private void CtrlSubStart()
		{
			this.button_loadAccount.Enabled = false;
			this.button_loadServer.Enabled = false;
			this.button_insertIDPW.Enabled = false;
			this.button_insertServerOnlyone.Enabled = false;
			this.textBox_accountCur.Enabled = false;
			this.textBox_serverCur.Enabled = false;
		}

		private void CtrlSubStop()
		{
			this.button_loadAccount.Enabled = true;
			this.button_loadServer.Enabled = true;
			this.button_insertIDPW.Enabled = true;
			this.button_insertServerOnlyone.Enabled = true;
			this.textBox_accountCur.Enabled = true;
			this.textBox_serverCur.Enabled = true;
		}

		private void textBox_sendLimitAccount_TextChanged(object sender, EventArgs e)
		{
			try
			{
				this.m_sendLimitAccount = Convert.ToInt32(this.textBox_sendLimitAccount.Text);
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("sendLimitAccount", this.m_sendLimitAccount);
			}
			catch
			{
				this.textBox_sendLimitAccount.Text = "";
			}
		}

		private void richTextBox_directHeader_TextChanged(object sender, EventArgs e)
		{
			this.m_directHeader = this.richTextBox_directHeader.Text;
			RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
			registryKey.SetValue("directHeader", this.m_directHeader);
		}

		private void textBox_bcc_TextChanged(object sender, EventArgs e)
		{
			try
			{
				this.m_Bcc = Convert.ToInt32(this.textBox_bcc.Text);
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("Bcc", this.m_Bcc);
			}
			catch
			{
				this.textBox_bcc.Text = "";
			}
		}

		private void textBox_rndDongbong_min_TextChanged(object sender, EventArgs e)
		{
			try
			{
				this.m_rndDongBongMin = Convert.ToInt32(this.textBox_rndDongbong_min.Text);
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("rndDongBongMin", this.m_rndDongBongMin);
			}
			catch
			{
				this.textBox_rndDongbong_min.Text = "";
			}
		}

		private void textBox_rndDongbong_max_TextChanged(object sender, EventArgs e)
		{
			try
			{
				this.m_rndDongBongMax = Convert.ToInt32(this.textBox_rndDongbong_max.Text);
				RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("C#Programing").CreateSubKey("NaverAuthSmtp");
				registryKey.SetValue("rndDongBongMax", this.m_rndDongBongMax);
			}
			catch
			{
				this.textBox_rndDongbong_max.Text = "";
			}
		}

    }
}
